<?php
namespace app\common\validate;

use think\Validate;

class CmsPictureValidate extends Validate
{
    // 验证规则
    protected $rule = [
        'title|图片标题'     => 'require',
        'cid|栏目'         => 'require',
        'thumb|缩略图'      => 'require',
        'atlas|图集'       => 'require',
        'sort|排序'        => 'number',
        'content_tpl|模板' => 'require',
        'status|状态'      => 'number',
    ];
    //验证场景
    protected $scene = [
        'add'  => ['title', 'cid', 'thumb', 'atlas', 'sort', 'content_tpl', 'status'],
        'edit' => ['title', 'cid', 'thumb', 'atlas', 'sort', 'content_tpl', 'status'],
    ];
}